import java.util.HashMap;

public class work2 {
        public  static String minWindow(String s, String t) {
            String ret=s;
            HashMap<Character,Integer>map=new HashMap<>();
            int slen=s.length();
            int tlen=t.length();
            if(slen<tlen)return"";
            if(s.equals(t))return t;
            for (int i = 0; i <tlen ; i++) {
                map.put(t.charAt(i),map.getOrDefault(t.charAt(i),0)+1);
            }
            HashMap<Character,Integer>map1=new HashMap<>();
            int left=0,right=0,count=0;
            int sret=Integer.MAX_VALUE;
            int begin=-1;
            while (right<slen){
                char temp=s.charAt(right);
                map1.put(temp,map1.getOrDefault(temp,0)+1);
                if(map1.get(temp)== map.getOrDefault(temp,0))count++;
                while (count==map.size()&&left<=right){
                    if(right-left+1<sret){
                        sret=right-left+1;
                        begin=left;
                    }
                    if(map1.get(s.charAt(left))== map.getOrDefault(s.charAt(left),0))count--;
                    map1.put(s.charAt(left),map1.getOrDefault(s.charAt(left),0)-1);
                    left++;
                }
                right++;
            }
            if(sret==slen)return s;
            return ret==s?"":ret;
        }
    public static void main(String[] args) {
        String s="A";
        String t="B";
        System.out.println(minWindow(s,t).toString());
    }
}
